/**
	The Minerva Project, DAG Scheduling Tools
	Copyright (C) 2006 Florin Pop & Stefan Bucur

	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
 */

package ro.pub.cs.minerva.resource;

import java.io.Serializable;

/**
 * @author Florin Pop
 *
 */
public class Resource implements Serializable {
	
	private static final long serialVersionUID = 200701031707L;
	
	private String procId;
	
	// name of the farm to which this processor belongs
	private String farmName;

	 // name of the cluster to which this processor belongs
	private String clusterName;
	
	// name of the computing resource
	private String nodeName;
	
	// the parameters which describe the node characteristics
	private ResourceParameters parameters;
	
	public Resource(){
		this.procId = "MinervaResource";
		this.farmName = "MinervaFarm";
		this.clusterName = "MinervaCluster";
		this.nodeName = "MinervaNode";
		this.parameters = null;
	}

	/**
	 * @param procId
	 * @param farmName
	 * @param clusterName
	 * @param nodeName
	 * @param parameters
	 */
	public Resource(String procId, String farmName, String clusterName, String nodeName, ResourceParameters parameters) {
		this.procId = procId;
		this.farmName = farmName;
		this.clusterName = clusterName;
		this.nodeName = nodeName;
		this.parameters = parameters;
	}

	/**
	 * @return the clusterName
	 */
	public String getClusterName() {
		return clusterName;
	}

	/**
	 * @param clusterName the clusterName to set
	 */
	public void setClusterName(String clusterName) {
		this.clusterName = clusterName;
	}

	/**
	 * @return the farmName
	 */
	public String getFarmName() {
		return farmName;
	}

	/**
	 * @param farmName the farmName to set
	 */
	public void setFarmName(String farmName) {
		this.farmName = farmName;
	}

	/**
	 * @return the nodeName
	 */
	public String getNodeName() {
		return nodeName;
	}

	/**
	 * @param nodeName the nodeName to set
	 */
	public void setNodeName(String nodeName) {
		this.nodeName = nodeName;
	}

	/**
	 * @return the parameters
	 */
	public ResourceParameters getParameters() {
		return parameters;
	}

	/**
	 * @param parameters the parameters to set
	 */
	public void setParameters(ResourceParameters parameters) {
		this.parameters = parameters;
	}

	/**
	 * @return the procId
	 */
	public String getProcId() {
		return procId;
	}

	/**
	 * @param procId the procId to set
	 */
	public void setProcId(String procId) {
		this.procId = procId;
	}
	
	public String toString() {
		return new String("[procId=" + procId + ",farmName=" + farmName + ",clusterName=" + 
				clusterName + ",nodeName=" + nodeName + ",parameters=" + 
				parameters.toString() + "]");
	}
}
